From 3170d5a2a7b3b9344087380ec26f8901125ba41a Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Mon, 29 May 2006 08:39:00 +0000 Subject: [PATCH] applied patch from Chris Wilson which replaces a useless loop with 2006-05-29 Michael Natterer * gtk/gtktextview.c (gtk_text_view_target_list_notify): applied patch from Chris Wilson which replaces a useless loop with built-in access to free'd memory by a simple integer comparison. Fixes bug #342894. --- ChangeLog | 7 +++++++ ChangeLog.pre-2-10 | 7 +++++++ gtk/gtktextview.c | 9 +++------ 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index ec6b6542c5..99c1ad23f4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-05-29 Michael Natterer + + * gtk/gtktextview.c (gtk_text_view_target_list_notify): applied + patch from Chris Wilson which replaces a useless loop with + built-in access to free'd memory by a simple integer comparison. + Fixes bug #342894. + 2006-05-29 Kristian Rietveld * gtk/gtktreeview.c (gtk_tree_view_move_cursor_up_down): select diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index ec6b6542c5..99c1ad23f4 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,10 @@ +2006-05-29 Michael Natterer + + * gtk/gtktextview.c (gtk_text_view_target_list_notify): applied + patch from Chris Wilson which replaces a useless loop with + built-in access to free'd memory by a simple integer comparison. + Fixes bug #342894. + 2006-05-29 Kristian Rietveld * gtk/gtktreeview.c (gtk_tree_view_move_cursor_up_down): select diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c index 0354f14de2..45c250ccab 100644 --- a/gtk/gtktextview.c +++ b/gtk/gtktextview.c @@ -6883,16 +6883,13 @@ gtk_text_view_target_list_notify (GtkTextBuffer *buffer, while (list) { GtkTargetPair *pair = list->data; - guint info; list = g_list_next (list); /* get next element before removing */ - for (info = GTK_TEXT_BUFFER_TARGET_INFO_BUFFER_CONTENTS; - info >= GTK_TEXT_BUFFER_TARGET_INFO_TEXT; - info--) + if (pair->info >= GTK_TEXT_BUFFER_TARGET_INFO_TEXT && + pair->info <= GTK_TEXT_BUFFER_TARGET_INFO_BUFFER_CONTENTS) { - if (pair->info == info) - gtk_target_list_remove (view_list, pair->target); + gtk_target_list_remove (view_list, pair->target); } } -- 2.30.2